#ifndef QMAINVIEW_H
#define QMAINVIEW_H

#include <QWidget>
#include <map> 
#include <string>
#include "ui_qmainview.h"
#define XADD 0
#define YADD 100
#define N0_0X 50+XADD
#define N0_0Y 0+YADD
#define N0_1X N0_0X+XADD
#define N0_1Y 90+2+YADD
#define N0_2X 230+XADD
#define N0_2Y N0_1Y
#define N0_3X 140+XADD
#define N0_3Y N0_1Y
#define N0_4X N0_3X
#define N0_4Y N0_1Y+42
#define N0_5X N0_3X
#define N0_5Y N0_4Y+42
#define N0_6X N0_3X
#define N0_6Y N0_5Y+42
#define N0_7X N0_3X
#define N0_7Y N0_6Y+42

#define N1_0X 350+XADD
#define N1_0Y
#define N1_1X 
#define N1_1Y
#define N1_2X 450+XADD
#define N1_2Y
#define N1_3X 550+XADD
#define N1_4X
#define N1_4Y
#define N1_5X
#define N1_5Y
#define N1_6X 700+XADD
#define N1_7X 810+XADD
#define N1_8X 900+XADD
#define N1_9X 1000+XADD
#define N2_0Y (LINEADD+YADD)
#define LINEADD 65
#define NODECOLOR1 Qt::lightGray
#define NODECOLOR2 Qt::yellow
#define LINECOLOR  Qt::blue
#define LINEWIDTH  3
class QGraphicsItem;
class QGraphicsScene;
class QGraphicsView;
class Link;
class Node;
class QTextCodec;
class CSiimData;
class QGraphicsLineItem;
class QSlider;
using namespace std;
class QMainView : public QWidget
{
	Q_OBJECT

public:
	QMainView(QWidget *parent = 0);
	~QMainView();

private:
	Ui::QMainView ui;
	QGraphicsScene *scene;
	QGraphicsView *view;
	QTextCodec *codec;
	QGraphicsLineItem *QLine;
	void setupNode(Node *node);
	void CreateLine(int i,int x);
	void CreateTempNode();
	CSiimData *pData;
	map<string,void*> m_map;
	QSlider *zoomSlider;
public:
	void SetDataPoint(CSiimData *pSiimData);
	void Refresh();
private slots:
	void setupMatrix();
};

#endif // QMAINVIEW_H
